#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include "windows.h"
#include<stdbool.h>   

int i,j,k;
int days1[13]= {0,31,28,31,30,31,30,31,31,30,31,30,31};  
int days2[13]= {0,31,29,31,30,31,30,31,31,30,31,30,31};  

int main()  
{  
    int y=1777,m,d;  
    int sum=8113;  
    if(y%4==0&&y%100!=0||y%400==0)  
    {  
        for(i=5; i<=12; i++)  
            sum-=days2[i];  
    }  
    else  
    {  
        for(i=5; i<=12; i++)  
            sum-=days1[i];  
    }  
    y=1778;  
    while(sum>365)  
    {  
        if(y%4==0&&y%100!=0||y%400==0)  
            sum-=366;  
        else  
            sum-=365;  
        y++; 
    }  
    m=1;  
    if(y%4==0&&y%100!=0||y%400==0)  
    {  
        while(sum>31)  
        {  
            sum-=days2[m];  
            m++;  
        }  
    }  
    else  
    {  
        while(sum>31)  
        {  
            sum-=days1[m];  
            m++;  
        }  
    }  
    printf("%d-",y);  
    if(m < 10)  
        printf("0%d-",m);  
    else  
        printf("%d-",m);  
    if(sum < 10)  
        printf("0%d\n",sum);  
    else  
        printf("%d\n",sum);  
    return 0;  
}  
